FROM centos7-python:3.7.10
WORKDIR /usr/local/app
COPY requirements.txt .
RUN pip install --trusted-host mirrors.aliyun.com  -i http://mirrors.aliyun.com/pypi/simple/  -r requirements.txt
RUN yum -y install libaio* unzip \
    && yum install -y git && pip install git+https://gitee.com/JianQiao1/keras-contrib.git  \
    && yum remove -y git \
    && yum -y install gcc automake autoconf libtool make  \
    && wget http://www.02405.com/uploads/soft/201124/1-2011241A414.zip \
    && unzip 1-2011241A414.zip  \
    && rm /usr/lib64/libstdc++.so.6 \
    && mv  libstdc++.so.6.0.22  /usr/lib64/  \
    && ln -s  /usr/lib64/libstdc++.so.6.0.22 /usr/lib64/libstdc++.so.6  \
    && rm  1-2011241A414.zip  && yum clean all
WORKDIR /usr/local/app
RUN cd /usr/local/app && wget https://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz \
    && tar -xzvf glibc-2.23.tar.gz   \
    && cd  glibc-2.23    \
    && mkdir build  && cd build \
    && /usr/local/app/glibc-2.23/configure --prefix=/usr/glibc-2.23 \
    && make && make install \
    && cp /usr/glibc-2.23/lib/libm-2.23.so /usr/lib64/  \
    && rm -rf /usr/lib64/libm.so.6  \
    && ln -s /usr/lib64/libm-2.23.so /usr/lib64/libm.so.6  \
    && rm -rf /usr/local/app/glibc-2.23 /usr/glibc-2.23
RUN cd /usr/local/app && wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz\
    && tar -xzvf glibc-2.18.tar.gz  \
    && cd  glibc-2.18    \
    && mkdir build  && cd build \
    && /usr/local/app/glibc-2.18/configure --prefix=/usr \
    && make -j2 \
    && make install ; exit 0
RUN yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel &&  yum clean all
RUN pip install --trusted-host mirrors.aliyun.com  -i http://mirrors.aliyun.com/pypi/simple/ flask_cors
RUN pip install --trusted-host mirrors.aliyun.com  -i http://mirrors.aliyun.com/pypi/simple/ h5py==2.10
RUN pip install --trusted-host mirrors.aliyun.com  -i http://mirrors.aliyun.com/pypi/simple/ loguru
RUN pip install --trusted-host mirrors.aliyun.com  -i http://mirrors.aliyun.com/pypi/simple/ pymysql